<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
        <meta http-equiv="pragma" content="no-cache">
        <meta http-equiv="cache-control" content="no-cache">
        <meta http-equiv="expires" content="0">
        <link rel="stylesheet" type="text/css"
            href="<c:url value="/static/jquery-easyui/themes/default/easyui.css"/>">
        <link rel="stylesheet" type="text/css"
            href="<c:url value="/static/jquery-easyui/themes/icon.css"/>">
        <link rel="Stylesheet" type="text/css"
            href="<c:url value="/static/css/jquery.ui.css"/>" />
        <script type="text/javascript"
            src="<c:url value="/static/jquery-easyui/jquery-1.6.min.js"/>"></script>
        <script type="text/javascript"
            src="<c:url value="/static/jquery-easyui/jquery.easyui.min.js"/>"></script>
        <script type="text/javascript"
            src="<c:url value="/static/jquery-easyui/plugins/jquery.panel.js"/>"></script>
        <script type="text/javascript"
            src="<c:url value="/static/jquery-easyui/plugins/jquery.datagrid.js"/>"></script>
        <script type="text/javascript"
            src="<c:url value="/static/jquery-easyui/plugins/jquery.messager.js"/>"></script>
        <script type="text/javascript"
            src="<c:url value="/static/jquery-easyui/ext-for-framework.js.jsp"/>"></script>
        <script type="text/javascript" src="<c:url value="/static/jquery-easyui/locale/easyui-lang-zh_CN.js"/>"></script>   
        <script type="text/javascript"
            src="<c:url value="/static/js/common.js"/>"></script>       
        <script type="text/javascript" src="<c:url value="/static/js/Loading.js"/>"></script>
        <script type="text/javascript"
            src="<c:url value="/static/js/showMsg.js"/>"></script>
        <script type="text/javascript"
            src="<c:url value="/static/listBox/jquery.clever.listbox.js"/>"></script>
        
        <script>
            var dataLeft;
			$(document).ready(function() {
				
			});
			  
		    
			function excel(){
				$('#AddFoodForm').form('submit',
		 				{
		 					url:'<c:url value='/supplier/exportSupperExcelCost.do'/>', //查询提交路径
		 					onSubmit:function()//提交按钮相应函数
		 					{
		 		                //校验
                                if($('#orderDate').datebox('getValue') ==''){
                                    $.messager.alert('提示','订单日期没有填写！','info');
                                    closeShow();
                                }
		 						return $('#AddFoodForm').form('validate');
		 					},
		 					success:function(data){
		                        data = eval( "("+data+")" );
		                        if(data.success){
		                            $.messager.alert("提示", "提交成功！", 'info');
		                        }else{
		                            var message = "";
		                            if(data.msg == "msg002"){
		                                message = "所选择日期的材料订单已经下单完成，如需重新选择请删除已有订单。";
		                            }else if(data.msg == "msg001"){
		                                message = "选择材料的时间已过，请联系采购部。";
		                            }else {
		                            	message =data.msg;
		                            }
		                            $.messager.alert("提示", message, 'warning');
		                        }
		                    },
		                    error:function(){
		                        $.messager.alert("错误", "系统错误，请联系管理员！", 'error');
		                        return;
		                    }
		 				});
				
				
			}
			
		</script>
			</head>
			<body>
			<table width="98%">
			<tr><td>
				<form id="AddFoodForm" name="AddFoodForm" method="post">
				<div style="height: auto; width:1180px;background: #fafafa; padding: 5px;" class="easyui-panel" title="送货报表导出" iconCls="icon-add" collapsible="true" minimizable="false" maximizable="false" closable="false">
			    <table cellpadding="5">
			      <tr>
                  	<td>日期</td>
                    <td>
 			            <input class="easyui-datebox" name="orderDate" id="orderDate" editable="false" data-options="required:true"/> 
 			        </td>
                  </tr>
                  
                  <tr>
                      <td>
                        <a href="#" class="easyui-linkbutton" onclick="excel();">导出</a>
                      </td>
                  </tr>
				        <input class="easyui-validatebox" type="hidden" name="idList"  />
				        <input class="easyui-validatebox" type="hidden" name="excelList"  />
				        <input class="easyui-validatebox" type="hidden" name="footList"  />
				        <input class="easyui-validatebox" type="hidden" name="supId" value="0"  />
				        
                </table>
                </div>
                </form>
            </td></tr>
            </table>
			<table width="98%">
			<tr>
		</table>
	</body>
	
	
</html>